﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ServerConsoleTest;

namespace TCPServer
{
    internal class CommandsReceived 
    {
        public Dictionary<string, Delegate> commands = new Dictionary<string, Delegate>(StringComparer.OrdinalIgnoreCase)
        {
            /*{"ID", (Func<string>)returnID}*/
        };
    }


    class CommandsSent : Program
    {
        public static Dictionary<string, Delegate> commands = new Dictionary<string, Delegate>(StringComparer.OrdinalIgnoreCase)
        {
            {"clients", (Action)numberOfClients},
            {"help", (Action)printHelp}
        };

        public static Dictionary<string, Delegate> paramCommands = new Dictionary<string, Delegate>(StringComparer.OrdinalIgnoreCase){
            
            {"messageall", (Action<string>)sendAll},
            {"global",  (Action<string>)sendAll},
            {"closeserver", (Action<string>)sendAll}
        };

        static private void printHelp()
        {
            Console.WriteLine("the following list of commands can be used:\n");
            Console.WriteLine("\thelp - shows this help");
            Console.WriteLine("\tclients - shows the number of clients");
            Console.WriteLine("\tglobal - followed by a message will send it to all clients");
            Console.WriteLine("\tmessageall - followed by a message will send it to all clients");
            Console.WriteLine("\tcloseserver - shuts down the server *currently does nothing*");
        }
    }
}
